#pragma once
 

class WPENGIN_API CMeshInstance : public IRenderable{
  friend struct RAY;
public:
	CMeshInstance();
	CMeshInstance(CMesh *meshPtr);
	void Render();
	void SetDefaultMateril(bool bMateril){m_bDefaultMaterial=bMateril; }
	void SetMesh(CMesh *m)			{m_pMesh = m;}
	void SetPosition(D3DXVECTOR3 p)	{m_pos = p;}
	void SetRotation(D3DXVECTOR3 r)	{m_rot = r;}
	void SetScale(D3DXVECTOR3 s)	{m_sca = s;}

	D3DXMATRIX GetWorldMatrix();
	BoundingBox GetBoundingBox();
	BoundingSphere GetBoundingSphere();

	virtual void OnD3D9FrameRender( float fElapsedTime=0.0f );

	bool m_bDefaultMaterial;
	CMesh *m_pMesh;
	D3DXVECTOR3 m_pos, m_rot, m_sca;
};


 





 









